package com.handu.luna.mall.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.handu.luna.core.domain.advertisement.AdPositionId.BelongPage;
import com.handu.luna.core.domain.advertisement.AdvertiseList;
import com.handu.luna.core.domain.goods.Goods;
import com.handu.luna.core.domain.promotion.Topic;

@Controller
public class IndexController extends BaseController{
	
	//点击搜索按钮
	@RequestMapping(value = {"index","/",""})  //size = DEFAULT_PAGE_SIZE
	public MallModelView index(){
		
		
		
 		return buildModelView("/index/index")
		    .add("categories",context.getCategoryRepository().getDisplayList())   //所有的分类
		    
		    .add("allAds", new AdvertiseList().getAdListsInfo(BelongPage.INDEXPAGE)) //所有的广告
		    
		    .add("TopicEachModuleGoods", new Topic().getTopicGoodsInfo(Long.parseLong("17")))   //  17  ,1  每日限量特卖和热销排行榜   读的是一个专题里面的模块商品 	
		    
		    .add("TopicEachModuleGoodsBrand", new Topic().getTopicGoodsInfo(Long.parseLong("18")))   //12  18   各个品牌下面的商品列表
		    
		    .add("newHstyle", new Goods().getGoods(1, "1", "goodsManageSort","desc",5))  //新品上市_韩风女装  “1”代表新品
		    .add("newAmh", new Goods().getGoods(3, "1", "goodsManageSort","desc",5))  //新品上市_韩风男装  new PageRequest(0, 1)  
		    .add("newSulv", new Goods().getGoods(16, "1", "goodsManageSort","desc",5))  //新品上市_原创女装
 		    .add("newOl", new Goods().getGoods(18, "1", "goodsManageSort","desc",5))  //新品上市_OL女装
 		    .add("newNibbuns", new Goods().getGoods(26, "1", "goodsManageSort","desc",5));  //新品上市_欧美女装
 		
   
	}

	
	

	 

	
	
	
	
	
}
